import requests
from lxml import etree

url='http://www.8q83.com/0_100.html'
headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'
}
response=requests.get(url,headers=headers)
response.encoding=response.apparent_encoding
data=response.text
# print(data)
x_data=etree.HTML(data)
results=x_data.xpath('//dd[position()>9]/a/@href')
# result=results.remove[0]
results.remove('/0_100/4387')
results.remove('/0_100/4386')
results.remove('/0_100/4385')
results.remove('/0_100/4390')
results.remove('/0_100/4389')
results.remove('/0_100/4388')
#http://www.8q83.com/0_100/9
try:
    for i in results:
        url='http://www.8q83.com'+i
        response=requests.get(url,headers=headers)
        response.encoding=response.apparent_encoding
        data=response.text
        x_data=etree.HTML(data)
        text=x_data.xpath('//div[@id="content"]/p/text()')

        print(text)
except:
    pass
print(1)

